#ifndef _T_GL_ASSET_H_
#define _T_GL_ASSET_H_

#include "../interface/I_Asset.h"

#include "../interface/T_gl_SpatialTree.h"
#include "../interface/C_gl_Buffer.h"

#include "../cuCommon/cuTypes.h"

class I_Actor;

typedef float4 T_pos;
typedef float4 T_nml;
typedef float4 T_tnt;
typedef float4 T_bnt;
typedef float4 T_clr;
typedef float2 T_uv;
typedef int T_idx;

class C_gl_Asset : public I_Asset
{
	friend class I_Actor;

private:
	int m_nPrimitive;
	int m_nVertex;

public:                                                      
								C_gl_Asset(void);
	virtual				~C_gl_Asset(void);

	virtual int	nPrimitive() { return m_nPrimitive; }
	virtual int nVertex() { return m_nVertex; }

	virtual void Create(int nVertexCount, int nFaceCount, int nFlag, I_api_Device * pDevice = NULL);
	virtual void Create(int nVertexCount, int nFaceCount, int nFlag, I_Asset * pShared);

	virtual bool Deserialize(char * pFileName, I_api_Device *pDevice);
	virtual bool Deserialize(char * pFileName, I_Asset * pShared);
	virtual bool Serialize(char * pFileName);

	virtual void Build(int nType);
};

#endif // _T_GL_ASSET_H_